<?php

/**
 * PageProfile form base class.
 *
 * @method PageProfile getObject() Returns the current form's model object
 *
 * @package    faceshop
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePageProfileForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'page_id'                  => new sfWidgetFormInputHidden(),
      'current_api_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CurrentApp'), 'add_empty' => false)),
      'previous_api_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PreviousApp'), 'add_empty' => true)),
      'type'                     => new sfWidgetFormInputText(),
      'category'                 => new sfWidgetFormInputText(),
      'name'                     => new sfWidgetFormInputText(),
      'picture'                  => new sfWidgetFormTextarea(),
      'link'                     => new sfWidgetFormTextarea(),
      'likes_in_install'         => new sfWidgetFormInputText(),
      'client_id'                => new sfWidgetFormInputText(),
      'salesforce_id'            => new sfWidgetFormInputText(),
      'billing_email'            => new sfWidgetFormInputText(),
      'invoice_link'             => new sfWidgetFormTextarea(),
      'apply_enabled'            => new sfWidgetFormInputCheckbox(),
      'apply_method'             => new sfWidgetFormChoice(array('choices' => array('email' => 'email', 'url' => 'url'))),
      'apply_address'            => new sfWidgetFormTextarea(),
      'culture'                  => new sfWidgetFormInputText(),
      'job_slots'                => new sfWidgetFormInputText(),
      'credit_amount'            => new sfWidgetFormInputText(),
      'credit_currency'          => new sfWidgetFormInputText(),
      'is_test'                  => new sfWidgetFormInputCheckbox(),
      'is_places'                => new sfWidgetFormInputCheckbox(),
      'smart_sort_threshold'     => new sfWidgetFormInputText(),
      'smart_share_threshold'    => new sfWidgetFormInputText(),
      'is_smart_sort_activated'  => new sfWidgetFormInputCheckbox(),
      'is_smart_share_activated' => new sfWidgetFormInputCheckbox(),
      'show_ad'                  => new sfWidgetFormInputCheckbox(),
      'show_recruiter_access'    => new sfWidgetFormInputCheckbox(),
      'apply_iframe'             => new sfWidgetFormInputCheckbox(),
      'top_banner_url'           => new sfWidgetFormTextarea(),
      'top_banner_map'           => new sfWidgetFormInputText(),
      'bottom_banner_url'        => new sfWidgetFormTextarea(),
      'bottom_banner_map'        => new sfWidgetFormInputText(),
      'job_logo_url'             => new sfWidgetFormTextarea(),
      'job_logo_map'             => new sfWidgetFormInputText(),
      'custom_filters'           => new sfWidgetFormInputCheckbox(),
      'location_filter'          => new sfWidgetFormInputCheckbox(),
      'max_jobs_per_page'        => new sfWidgetFormInputText(),
      'custom_tracking'          => new sfWidgetFormInputCheckbox(),
      'xtsd'                     => new sfWidgetFormInputText(),
      'xtsite'                   => new sfWidgetFormInputText(),
      'xtn2'                     => new sfWidgetFormInputText(),
      'rt_valid'                 => new sfWidgetFormInputCheckbox(),
      'rt_updated_at'            => new sfWidgetFormDateTime(),
      'fb_info_updated_at'       => new sfWidgetFormDateTime(),
      'fb_info_sync_error'       => new sfWidgetFormInputCheckbox(),
      'created_at'               => new sfWidgetFormDateTime(),
      'updated_at'               => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'page_id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('page_id')), 'empty_value' => $this->getObject()->get('page_id'), 'required' => false)),
      'current_api_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CurrentApp'))),
      'previous_api_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PreviousApp'), 'required' => false)),
      'type'                     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'category'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'name'                     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'picture'                  => new sfValidatorString(array('max_length' => 2000, 'required' => false)),
      'link'                     => new sfValidatorString(array('max_length' => 2000, 'required' => false)),
      'likes_in_install'         => new sfValidatorInteger(),
      'client_id'                => new sfValidatorInteger(),
      'salesforce_id'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'billing_email'            => new sfValidatorString(array('max_length' => 255)),
      'invoice_link'             => new sfValidatorString(array('max_length' => 2000)),
      'apply_enabled'            => new sfValidatorBoolean(array('required' => false)),
      'apply_method'             => new sfValidatorChoice(array('choices' => array(0 => 'email', 1 => 'url'), 'required' => false)),
      'apply_address'            => new sfValidatorString(array('max_length' => 2000, 'required' => false)),
      'culture'                  => new sfValidatorString(array('max_length' => 7)),
      'job_slots'                => new sfValidatorInteger(array('required' => false)),
      'credit_amount'            => new sfValidatorInteger(array('required' => false)),
      'credit_currency'          => new sfValidatorString(array('max_length' => 3, 'required' => false)),
      'is_test'                  => new sfValidatorBoolean(array('required' => false)),
      'is_places'                => new sfValidatorBoolean(array('required' => false)),
      'smart_sort_threshold'     => new sfValidatorInteger(array('required' => false)),
      'smart_share_threshold'    => new sfValidatorInteger(array('required' => false)),
      'is_smart_sort_activated'  => new sfValidatorBoolean(array('required' => false)),
      'is_smart_share_activated' => new sfValidatorBoolean(array('required' => false)),
      'show_ad'                  => new sfValidatorBoolean(array('required' => false)),
      'show_recruiter_access'    => new sfValidatorBoolean(array('required' => false)),
      'apply_iframe'             => new sfValidatorBoolean(array('required' => false)),
      'top_banner_url'           => new sfValidatorString(array('max_length' => 2000)),
      'top_banner_map'           => new sfValidatorPass(),
      'bottom_banner_url'        => new sfValidatorString(array('max_length' => 2000)),
      'bottom_banner_map'        => new sfValidatorPass(),
      'job_logo_url'             => new sfValidatorString(array('max_length' => 2000)),
      'job_logo_map'             => new sfValidatorPass(),
      'custom_filters'           => new sfValidatorBoolean(array('required' => false)),
      'location_filter'          => new sfValidatorBoolean(array('required' => false)),
      'max_jobs_per_page'        => new sfValidatorInteger(array('required' => false)),
      'custom_tracking'          => new sfValidatorBoolean(array('required' => false)),
      'xtsd'                     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'xtsite'                   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'xtn2'                     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'rt_valid'                 => new sfValidatorBoolean(array('required' => false)),
      'rt_updated_at'            => new sfValidatorDateTime(array('required' => false)),
      'fb_info_updated_at'       => new sfValidatorDateTime(),
      'fb_info_sync_error'       => new sfValidatorBoolean(array('required' => false)),
      'created_at'               => new sfValidatorDateTime(),
      'updated_at'               => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('page_profile[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'PageProfile';
  }

}
